from PySide6.QtWidgets import QApplication, QMainWindow

from menu_ui import Ui_MainWindow


class MyWindow(QMainWindow, Ui_MainWindow):
    def __init__(self):
        super().__init__()
        self.setupUi(self)

        # 触发菜单栏信号
        self.actionOpen.triggered.connect(self.open_file)
        self.actionSave.triggered.connect(lambda: print('action save'))
        self.actionSaveAs.triggered.connect(lambda: print('action save as'))
        self.actionAdd1.triggered.connect(lambda: print('action add1'))

    @staticmethod
    def open_file():
        print('open file')


if __name__ == '__main__':
    app = QApplication([])
    window = MyWindow()
    window.show()
    app.exec()
